package abs.domain;

import java.io.Serializable;

import java.lang.StringBuilder;

import java.util.Calendar;
import java.util.Set;

import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.xml.bind.annotation.*;

import javax.persistence.*;

/**
 */

@Entity
@NamedQueries({
		@NamedQuery(name = "findAllDocumentoss", query = "select myDocumentos from Documentos myDocumentos"),
		@NamedQuery(name = "findDocumentosByCo030codi", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030codi = ?1"),
		@NamedQuery(name = "findDocumentosByCo030codiContaining", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030codi like ?1"),
		@NamedQuery(name = "findDocumentosByCo030desc", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030desc = ?1"),
		@NamedQuery(name = "findDocumentosByCo030descContaining", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030desc like ?1"),
		@NamedQuery(name = "findDocumentosByCo030fead", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030fead = ?1"),
		@NamedQuery(name = "findDocumentosByCo030feadAfter", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030fead > ?1"),
		@NamedQuery(name = "findDocumentosByCo030feadBefore", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030fead < ?1"),
		@NamedQuery(name = "findDocumentosByCo030femo", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030femo = ?1"),
		@NamedQuery(name = "findDocumentosByCo030femoAfter", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030femo > ?1"),
		@NamedQuery(name = "findDocumentosByCo030femoBefore", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030femo < ?1"),
		@NamedQuery(name = "findDocumentosByCo030load", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030load = ?1"),
		@NamedQuery(name = "findDocumentosByCo030loadContaining", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030load like ?1"),
		@NamedQuery(name = "findDocumentosByCo030lomo", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030lomo = ?1"),
		@NamedQuery(name = "findDocumentosByCo030lomoContaining", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030lomo like ?1"),
		@NamedQuery(name = "findDocumentosByPrimaryKey", query = "select myDocumentos from Documentos myDocumentos where myDocumentos.co030codi = ?1") })
@Table(catalog = "absV2", name = "co030")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "absWeb/abs/domain", name = "Documentos")
public class Documentos implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */

	@Column(name = "co030codi", length = 5, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	String co030codi;
	/**
	 */

	@Column(name = "co030desc", length = 30)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String co030desc;
	/**
	 */

	@Column(name = "co030load", length = 30)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String co030load;
	/**
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "co030fead")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Calendar co030fead;
	/**
	 */

	@Column(name = "co030lomo", length = 30)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String co030lomo;
	/**
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "co030femo")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Calendar co030femo;

	/**
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({ @JoinColumn(name = "co030nocia", referencedColumnName = "co000nocia", nullable = false) })
	@XmlTransient
	Companias companias;

	/**
	 */
	public void setCo030codi(String co030codi) {
		this.co030codi = co030codi;
	}

	/**
	 */
	public String getCo030codi() {
		return this.co030codi;
	}

	/**
	 */
	public void setCo030desc(String co030desc) {
		this.co030desc = co030desc;
	}

	/**
	 */
	public String getCo030desc() {
		return this.co030desc;
	}

	/**
	 */
	public void setCo030load(String co030load) {
		this.co030load = co030load;
	}

	/**
	 */
	public String getCo030load() {
		return this.co030load;
	}

	/**
	 */
	public void setCo030fead(Calendar co030fead) {
		this.co030fead = co030fead;
	}

	/**
	 */
	public Calendar getCo030fead() {
		return this.co030fead;
	}

	/**
	 */
	public void setCo030lomo(String co030lomo) {
		this.co030lomo = co030lomo;
	}

	/**
	 */
	public String getCo030lomo() {
		return this.co030lomo;
	}

	/**
	 */
	public void setCo030femo(Calendar co030femo) {
		this.co030femo = co030femo;
	}

	/**
	 */
	public Calendar getCo030femo() {
		return this.co030femo;
	}

	/**
	 */
	public void setCompanias(Companias companias) {
		this.companias = companias;
	}

	/**
	 */
	public Companias getCompanias() {
		return companias;
	}

	/**
	 */
	public Documentos() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(Documentos that) {
		setCo030codi(that.getCo030codi());
		setCo030desc(that.getCo030desc());
		setCo030load(that.getCo030load());
		setCo030fead(that.getCo030fead());
		setCo030lomo(that.getCo030lomo());
		setCo030femo(that.getCo030femo());
		setCompanias(that.getCompanias());
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("co030codi=[").append(co030codi).append("] ");
		buffer.append("co030desc=[").append(co030desc).append("] ");
		buffer.append("co030load=[").append(co030load).append("] ");
		buffer.append("co030fead=[").append(co030fead).append("] ");
		buffer.append("co030lomo=[").append(co030lomo).append("] ");
		buffer.append("co030femo=[").append(co030femo).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((co030codi == null) ? 0 : co030codi.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof Documentos))
			return false;
		Documentos equalCheck = (Documentos) obj;
		if ((co030codi == null && equalCheck.co030codi != null) || (co030codi != null && equalCheck.co030codi == null))
			return false;
		if (co030codi != null && !co030codi.equals(equalCheck.co030codi))
			return false;
		return true;
	}
}
